import request from '@/utils/request'

// 新增科目
export function addSubject(data) {
  return request({
    url: 'api/v1/sys-subject',
    method: 'post',
    data: data
  })
}

//   获取科目管理列表
export function getSubject(query) {
  return request({
    url: 'api/v1/public/subject',
    method: 'get',
    params: query
  })
}

// 获取取科目详情
export function getSubjectDetails(id) {
  return request({
    url: 'api/v1/sys-subject/' + id,
    method: 'get'
  })
}

// 删除科目知识点
export function delKnowledgePoint(id) {
  return request({
    url: 'api/v1/sys-subject/knowledge-point/' + id,
    method: 'delete'
  })
}

// 删除科目
export function delSubject(data) {
  return request({
    url: 'api/v1/sys-subject',
    method: 'delete',
    data: data
  })
}

// 新增知识点
export function addKnowledgePoint(data) {
  return request({
    url: 'api/v1/sys-subject/knowledge-point/add',
    method: 'post',
    data: data
  })
}
